package com.mxy.myapplication.testtouchevent;

import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.widget.RelativeLayout;

public class TestRelativeLayoutB extends RelativeLayout {
  public TestRelativeLayoutB(Context context) {
    super(context);
  }

  public TestRelativeLayoutB(Context context, AttributeSet attrs) {
    super(context, attrs);
  }


  @Override
  public boolean dispatchTouchEvent(MotionEvent ev) {
    System.out.println("LayoutB   dispatchTouchEvent");
//    System.out.println(super.dispatchTouchEvent(ev));
    return super.dispatchTouchEvent(ev);
  }


  @Override
  public boolean onInterceptTouchEvent(MotionEvent ev) {
    System.out.println("LayoutB   onInterceptTouchEvent");
//    System.out.println(super.onInterceptTouchEvent(ev));
    return super.onInterceptTouchEvent(ev);
  }

  @Override
  public boolean onTouchEvent(MotionEvent event) {
    System.out.println("LayoutB   onTouchEvent");
    switch(event.getAction()){
      case MotionEvent.ACTION_DOWN:
        System.out.println("LayoutB   ACTION_DOWN");
        break;
      case MotionEvent.ACTION_MOVE:
        System.out.println("LayoutB   ACTION_MOVE");
        break;
      case MotionEvent.ACTION_UP:
        System.out.println("LayoutB   ACTION_UP");
        break;
    }
//    System.out.println(super.onTouchEvent(event));
    return super.onTouchEvent(event);
  }
}
